package com.project.base.baseproject.ModelManager.IdentityManager;

import android.os.Handler;
import android.os.Message;

import com.project.base.baseproject.HttpService.HttpService;

import java.util.HashMap;
import java.util.Map;


/**
 * Created by mac on 2016/11/28.
 */
//登陆相关请求 只回传map，不回传对象
public class IdentityHttp {
    //账号密码登陆
    public static void userLogin(String account,String password,final Handler handler) {
        Map<String,String> parameters = new HashMap();
        parameters.put("email",account);
        parameters.put("password",password);
        HttpService.sendRequest(HttpService.E_HTTP_REQUEST_METHOD_POST,"Users/login",parameters,new Handler(){
            @Override
            public void handleMessage(Message msg) {
                super.handleMessage(msg);
                Message message = new Message();
                //obj是一个字典
                message.obj = msg.obj;
                message.what = msg.what;
                handler.sendMessage(message);
            }
        });
    }
}
